package com.xbts.system.enums;

/**
 * @Author llk
 * @Date 2023/8/3 15:16
 */
public enum FlavorTypEnum {

    NORMAL("normal", "通用计算型"),
    ENTRY("entry", "通用入门型"),
    CPUV1("cpuv1", "计算I型"),
    CPUV2("cpuv2", "计算II型"),
    COMPUTINGV3("computingv3", "通用计算增强型"),
    KUNPENG_COMPUTING("kunpeng_computing", "鲲鹏通用计算增强型"),
    KUNPENG_HIGHMEM("kunpeng_highmem", "鲲鹏内存优化型"),
    HIGHMEM("highmem", "内存优化型"),
    SAPHANA("saphana", "大内存型"),
    DISKINTENSIVE("diskintensive", "磁盘增强型"),
    HIGHIO("highio", "超高I/O型"),
    ULTRACPU("ultracpu", "超高性能计算型"),
    GPU("gpu", "GPU加速型"),
    FPGA("fpga", "FPGA加速型"),
    ASCEND("ascend", "AI加速型");

    private final String flavorType;
    private final String flavorTypeName;

    FlavorTypEnum(String flavorType, String flavorTypeName) {
        this.flavorType = flavorType;
        this.flavorTypeName = flavorTypeName;
    }

    public String getFlavorType() {
        return flavorType;
    }

    public String getFlavorTypeName() {
        return flavorTypeName;
    }

    // 通过flavorType获取flavorTypeName
    public static String getFlavorTypeNameByFlavorType(String flavorType) {
        for (FlavorTypEnum flavorTypEnum : FlavorTypEnum.values()) {
            if (flavorTypEnum.getFlavorType().equals(flavorType)) {
                return flavorTypEnum.getFlavorTypeName();
            }
        }
        return null;
    }
}
